<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>医疗管家</title>
    <meta name="description" content="医疗管家">
    <meta name="keywords" content="医疗管家">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">
</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>预约管理<small>检查项管理</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>预约管理</el-breadcrumb-item>
            <el-breadcrumb-item>检查项管理</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="app-container">
        <div class="box">
            <div id="show" style="width: 100%; height: 500px"></div>
        </div>
        <div class="box">
            <div id="show1" style="width: 100%; height: 500px"></div>
        </div>
    </div>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script src="../js/echarts.js"></script>


<script>
    let myecharts = echarts.init(document.getElementById("show"));


    //异步请求
    axios.get("/member/countMemberBySex").then(resp =>{
        if (resp.data.flag){
            let echartsData=resp.data.data;
            // 指定图表的配置项和数据
            var option = {
                title: {
                    text: '男女比例',
                    subtext: '本季度',
                    left: 'center'
                },
                tooltip: {
                    trigger: 'item'
                },
                legend: {
                    orient: 'vertical',
                    left: 'left'
                },
                series: [
                    {
                        name: '男女比例',
                        type: 'pie',
                        radius: '50%',
                        data: echartsData,
                        emphasis: {
                            itemStyle: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }
                ]
            };
            // 使用刚指定的配置项和数据显示图表。
            myecharts.setOption(option);
        }else{
            this.$message.error(resp.data.message);
        }
    })

    let myecharts1 = echarts.init(document.getElementById("show1"));
    axios.get("/member/countMemberByRegTime").then(resp =>{
        if (resp.data.flag){
            let echartsData=resp.data.data;
            // 指定图表的配置项和数据
            var option = {
                title: {
                    text: '统计2020年，1-12月各个月份新注册的会员数据'
                },
                tooltip: {},
                legend: {
                    data: ['数据']
                },
                xAxis: {
                    type: 'category',
                    data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月','8月','9月','10月','11月','12月']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: echartsData,
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
                            color: 'rgba(180, 180, 180, 0.2)'
                        }
                    }
                ]
            };
            // 使用刚指定的配置项和数据显示图表。
            myecharts1.setOption(option);
        }else{
            this.$message.error(resp.data.message);
        }
    })



</script>
</html>